﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DotNet.Practico1.UI.Presentation;

namespace DotNet.Practico1.UI
{
    public partial class frmGroups : Form, IGroupsView
    {
        #region
        protected GroupsPresenter _presenter;
        protected int _groupId;
        #endregion
        public frmGroups()
        {
            InitializeComponent();
            _presenter = new GroupsPresenter(this);
        }

        public int GroupId
        {
            get { return _groupId; }
            set { _groupId = value; }
        }

        public string GroupName
        {
            get { return txtName.Text; }
            set { txtName.Text = value; }
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            this._presenter.Save();
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }


    }
}
